﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UdpSocketClientAsync {
    public class UdpClientEventArgs : EventArgs {

        private object _ticket;
        public object Ticket {
            get {
                return this._ticket;
            }
        }

        private Exception _exception;
        public Exception Exception {
            get {
                return this._exception;
            }
        }

        private bool _hasException;
        public bool HasException {
            get {
                return this._hasException;
            }
        }

        private bool _treated;
        public bool Treated {
            get {
                return this._treated;
            }
            set {
                this._treated = value;
            }
        }

        private byte[] _buffer;
        public byte[] Buffer {
            get {
                return this._buffer;
            }
        }

        private int _offset;
        public int Offset {
            get {
                return this._offset;
            }
        }

        private int _length;
        public int Length {
            get {
                return this._length;
            }
        }

        internal UdpClientEventArgs(object ticket) {

            this._hasException = false;
            this._treated = false;
            this._exception = null;
            this._buffer = null;
            this._offset = 0;
            this._length = 0;
            this._ticket = ticket;
        }

        internal UdpClientEventArgs(object ticket, byte[] buffer, int offset, int length) {

            this._hasException = false;
            this._treated = false;
            this._exception = null;
            this._buffer = buffer;
            this._offset = offset;
            this._length = length;
            this._ticket = ticket;

        }

        internal UdpClientEventArgs(object ticket, Exception e) {

            this._hasException = true;
            this._treated = false;
            this._exception = e;
            this._ticket = ticket;

        }

    }
}
